package vip.xiaonuo.supplier.modular.custom.objects.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import vip.xiaonuo.common.pojo.CommonEntity;
import vip.xiaonuo.supplier.modular.base.delivery.entity.SupplierDelivery;
import vip.xiaonuo.supplier.modular.base.stores.entity.SupplierStores;
import vip.xiaonuo.supplier.modular.custom.customtag.entity.SupplierCustomTag;
import vip.xiaonuo.supplier.modular.custom.customtype.entity.SupplierCustomType;
import vip.xiaonuo.supplier.modular.structure.user.entity.SupplierUser;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 业务对象实体
 *
 * @author Mr.wu
 * @date  2025/04/19 11:37
 **/
@Getter
@Setter
@TableName("SUPPLIER_OBJECTS")
public class SupplierObjects extends CommonEntity {

    /** 业务对象ID */
    @TableId
    @Schema(description = "业务对象ID")
    private String id;

    /** 编号 */
    @Schema(description = "编号")
    private String objectCode;

    /** 类型 */
    @Schema(description = "类型")
    private String objectType;

    /** 名称 */
    @Schema(description = "名称")
    private String objectName;

    /** 负责人 */
    @Schema(description = "负责人")
    @Trans(type = TransType.SIMPLE, target = SupplierUser.class, fields = "name", alias = "customTag", ref = "objectPersonName")
    private String objectPerson;

    /**负责人姓名 */
    @Schema(description = "负责人姓名")
    @TableField(exist = false)
    private String objectPersonName;

    /** 联系人 */
    @Schema(description = "联系人")
    private String objectContact;

    /** 电话 */
    @Schema(description = "电话")
    private String objectTel;

    /** 地址 */
    @Schema(description = "地址")
    private String objectAddress;

    /** 邮箱 */
    @Schema(description = "邮箱")
    private String objectEmail;

    /** 开户行 */
    @Schema(description = "开户行")
    private String objectBank;

    /** 银行账号 */
    @Schema(description = "银行账号")
    private String objectBankCode;

    /** 默认折扣 */
    @Schema(description = "默认折扣")
    private BigDecimal objectDiscount;

    /** 允许赊账 */
    @Schema(description = "允许赊账")
    private String objectAllowCredit;

    /** 应收（付）账款 */
    @Schema(description = "应收（付）账款")
    private BigDecimal objectAccountsPayable;

    /** 客户积分 */
    @Schema(description = "客户积分")
    private Integer objectScore;

    /** 累计积分 */
    @Schema(description = "累计积分")
    private Integer objectScoreTotal;

    /** 附件 */
    @Schema(description = "附件")
    private String objectAttachment;

    /** 标签 */
    @Schema(description = "标签")
    @Trans(type = TransType.SIMPLE, target = SupplierCustomTag.class, fields = "customTag", alias = "customTag", ref = "objectTagName")
    private String objectTag;

    /**标签名称 */
    @Schema(description = "客户标签名称")
    @TableField(exist = false)
    private String objectTagName;

    /** 拼音码 */
    @Schema(description = "拼音码")
    private String objectPinyin;

    /** 所属门店 */
    @Schema(description = "所属门店")
    @Trans(type = TransType.SIMPLE, target = SupplierStores.class, fields = "storeName", alias = "store", ref = "objectStoreIdName")
    private String objectStoreId;

    /**所属门店名称 */
    @Schema(description = "所属门店名称")
    @TableField(exist = false)
    private String objectStoreIdName;

    /** 状态 */
    @Schema(description = "状态")
    private String objectStatus;

    /** 备注 */
    @Schema(description = "备注")
    private String objectRemark;

    /** 推荐人 */
    @Schema(description = "推荐人")
    private String objectReference;

    /** 允许访问商城 */
    @Schema(description = "允许访问商城")
    private String objectAllowtovisitmail;

    /** 默认发货方式 */
    @Schema(description = "默认发货方式")
    @Trans(type = TransType.SIMPLE, target = SupplierDelivery.class, fields = "delivery", alias = "delivery", ref = "objectDeliveryName")
    private String objectDelivery;

    /**默认发货方式名称 */
    @Schema(description = "默认发货方式名称")
    @TableField(exist = false)
    private String objectDeliveryName;

    /** 客户等级 */
    @Schema(description = "客户等级")
    @Trans(type = TransType.SIMPLE, target = SupplierCustomType.class, fields = "customTypeName", alias = "customType", ref = "objectGradeIdName")
    private String objectGradeId;

    /**客户等级名称 */
    @Schema(description = "客户等级名称")
    @TableField(exist = false)
    private String objectGradeIdName;

    /** 扩展信息 */
    @Schema(description = "扩展信息")
    private String extJson;

    /** 数据归属 */
    @Schema(description = "数据归属")
    private String companyId;
}
